import time
from datetime import datetime

from Comm.Driver import gdriver


class HomePage:
    def __init__(self, url):
        gdriver.get(url)
        gdriver.save_screenshot("../Images/" + "home_page_" + datetime.now().strftime("%Y%m%d_%H%M%S") + ".png")

        # 源码链接跳转返回
        gdriver.click(gdriver.find_element("body > div > div.content > a"))
        gdriver.save_screenshot("../Images/" + "Gitee_" + datetime.now().strftime("%Y%m%d_%H%M%S") + ".png")
        gdriver.back()